package com.talsy.objectAdapter;

import cn.hutool.core.util.ObjectUtil;
import com.talsy.classAdapter.Voltage220V;
import lombok.AllArgsConstructor;

@AllArgsConstructor
public class VoltageAdapter implements IVoltage5V {
    private Voltage220V voltage220V;

    @Override
    public int output5V() {
        int dstV = 0;
        if(ObjectUtil.isNotNull(voltage220V)){
            int srcV = voltage220V.output220V();
            System.out.println("使用对象适配器，进行适配");
            dstV = srcV / 44;
        }
        return dstV;
    }
}
